/**
 * Created by gongxun on 16/11/18.
 */

var KwxRoomCreateLayer = KwxSecondBase.extend({
    mParent: null,

    mTabButtons: null,
    mTabButtonNns: null,
    mTabButtonGsbdxs: null,
    mTabButtonPszs: null,
    mTabButtonDtj: null,

    //游戏名称
    mGameNames: null,
    mCheckBoxs: null,

    //kwx 不通规则不同层
    mPanel_contents: null,

    mImage_gameTags: null,
    mGameIndex: null,
    Panel_gameKwx: null,
    Panel_gameNn: null,
    Panel_gameWhmj: null,
    Panel_gameGsbdx: null,
    Panel_gamePsz: null,
    Panel_gameDzpk: null,
    Panel_gameDtj: null,
    Panel_gamePdk: null,

    mTableConfig: null,
    mTableConfigNn: null,
    mTableConfigWhmj: null,
    mTableConfigGsbdx: null,
    mTableConfigPsz: null,
    mTableConfigDzpk: null,
    mTableConfigDtj: null,
    mTableConfigPdk: null,
    ctor: function (gameNames, parent) {
        this._super();
        this.loadSecondCCS("res/ccs/KwxRoomCreateLayer.json");
        this.mGameNames = gameNames;
        this.mParent = parent;

        this.Panel_gameKwx = mo.seekWidgetByName(this.ccsNode, "Panel_gameKwx");
        this.Panel_gameNn = mo.seekWidgetByName(this.ccsNode, "Panel_gameNn");
        this.Panel_gameWhmj = mo.seekWidgetByName(this.ccsNode, "Panel_gameWhmj");
        this.Panel_gameGsbdx = mo.seekWidgetByName(this.ccsNode, "Panel_gameGsbdx");
        this.Panel_gamePsz = mo.seekWidgetByName(this.ccsNode, "Panel_gamePsz");
        this.Panel_gameDzpk = mo.seekWidgetByName(this.ccsNode, "Panel_gameDzpk");
        this.Panel_gameDtj = mo.seekWidgetByName(this.ccsNode, "Panel_gameDtj");
        this.Panel_gamePdk = mo.seekWidgetByName(this.ccsNode, "Panel_gamePdk");


        //返回
        this.setBtnBackFunc(function () {
            this.setVisible(false);
        }, this);

        //关闭
        mo.seekWidgetByName(this.ccsNode, "Button_return").addTouchEventListener(function (sender, type) {
            if (mo.gameHelper.getIsTouchEndMenuClose(type)) {
                parent.setVisible(false);
                this.setVisible(false);
            }
        }, this);

        //生死战选项
        this.mCheckBoxs = [];
        for (var i = 0; i < 2; i++) {
            var CheckBox_lod = mo.seekWidgetByName(this.ccsNode, "CheckBox_lod" + i);
            this.mCheckBoxs.push(CheckBox_lod);

            var Panel_lodTouch = mo.seekWidgetByName(CheckBox_lod, "Panel_lodTouch");
            Panel_lodTouch.setTag(i);
            Panel_lodTouch.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    var index = sender.getTag();
                    var check = this.mCheckBoxs[index];
                    check.setSelected(!check.isSelected());

                    var otherIndex = ((index + 1) % 2);
                    this.mCheckBoxs[otherIndex].setSelected(false);
                }
            }, this);
        }

        //创建房间
        mo.seekWidgetByName(this.ccsNode, "Button_create").addTouchEventListener(function (sender, type) {
            if (mo.gameHelper.getIsTouchEnd(type)) {

                //创建房间等待界面
                var gameNames = this.mGameNames;
                var gameName = gameNames[this.mGameIndex];
                mo.showWaitCreateTableLayer(gameName);

                //所选择的规则
                var tempConfigStr = JSON.stringify(this.getConfigForGameName(gameName));
                var selectConfig = JSON.parse(tempConfigStr);
                selectConfig.lod = this.getLODNum(gameName);

                var config = JSON.stringify(selectConfig);

                if (this.mGameIndex == 0) {
                    //3人场和2人场
                    if (selectConfig.hasOwnProperty("playerCount")) {
                        if (selectConfig.playerCount == 3) {
                            mo.gameMsgManager.kwxGameModel = 1;
                        } else if (selectConfig.playerCount == 2) {
                            mo.gameMsgManager.kwxGameModel = 2;
                        }
                        delete selectConfig.playerCount;
                    }
                    config = JSON.stringify(selectConfig);
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestkwx(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("kwx", this.mTableConfig);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 1) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestnn(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("nn", this.mTableConfigNn);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 2) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestgsbdx(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("gsbdx", this.mTableConfigGsbdx);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 3) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestpsz(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("psz", this.mTableConfigPsz);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 4) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestwhmj(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("whmj", this.mTableConfigWhmj);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 5) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestdzpk(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("dzpk", this.mTableConfigDzpk);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 6) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestdtj(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("dtj", this.mTableConfigDtj);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 7) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestpdk(mo.gameUserInfo.uid, -1, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("pdk", this.mTableConfigPdk);

                    this.mParent.setVisible(false);
                    this.closeAction();
                }
            }
        }, this);


        //已开
        mo.seekWidgetByName(this.ccsNode, "Button_yikai").addTouchEventListener(function (sender, type) {
            if (mo.gameHelper.getIsTouchEnd(type)) {
                mo.eventHelper.dispatch("showRoomYilaiLayer");
            }
        }, this);

        //代开
        mo.seekWidgetByName(this.ccsNode, "Button_daikai").addTouchEventListener(function (sender, type) {
            if (mo.gameHelper.getIsTouchEnd(type)) {
                var gameNames = this.mGameNames;
                var gameName = gameNames[this.mGameIndex];

                //所选择的规则
                var tempConfigStr = JSON.stringify(this.getConfigForGameName(gameName));
                var selectConfig = JSON.parse(tempConfigStr);
                selectConfig.lod = this.getLODNum(gameName);

                var config = JSON.stringify(selectConfig);

                if (this.mGameIndex == 0) {
                    //3人场和2人场
                    if (selectConfig.hasOwnProperty("playerCount")) {
                        if (selectConfig.playerCount == 3) {
                            mo.gameMsgManager.kwxGameModel = 1;
                        } else if (selectConfig.playerCount == 2) {
                            mo.gameMsgManager.kwxGameModel = 2;
                        }
                        delete selectConfig.playerCount;
                    }
                    config = JSON.stringify(selectConfig);
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestkwx(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("kwx", this.mTableConfig);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 1) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestnn(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("nn", this.mTableConfigNn);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 2) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestgsbdx(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("gsbdx", this.mTableConfigGsbdx);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 3) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestpsz(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("psz", this.mTableConfigPsz);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 4) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestwhmj(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("whmj", this.mTableConfigWhmj);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 5) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestdzpk(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("dzpk", this.mTableConfigDzpk);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 6) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestdtj(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("dtj", this.mTableConfigDtj);

                    this.mParent.setVisible(false);
                    this.closeAction();
                } else if (this.mGameIndex == 7) {
                    cc.log("选择的规则是:" + config);

                    mo.gameMsgManager.sendJoinFreeRequestpdk(mo.gameUserInfo.uid, -2, config);
                    mo.gameRoomRuleHelper.saveRuleConfig("pdk", this.mTableConfigPdk);

                    this.mParent.setVisible(false);
                    this.closeAction();
                }
            }
        }, this);

        //tab button
        this.mTabButtons = [];
        this.mTabButtons.push(mo.seekWidgetByName(this.Panel_gameKwx, "Button_tabXG"));
        this.mTabButtons.push(mo.seekWidgetByName(this.Panel_gameKwx, "Button_tabXY"));
        this.mTabButtons.push(mo.seekWidgetByName(this.Panel_gameKwx, "Button_tabSY"));
        this.mTabButtons.push(mo.seekWidgetByName(this.Panel_gameKwx, "Button_tabSZ"));
        for (var i = 0; i < this.mTabButtons.length; i++) {
            this.mTabButtons[i].setTag(i);
            this.mTabButtons[i].addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    this.intoTabIndex(sender.getTag());
                }
            }, this);
        }

        //tab Nn
        this.mTabButtonNns = [];
        this.mTabButtonNns.push(mo.seekWidgetByName(this.ccsNode, "Button_tabDZNn"));
        this.mTabButtonNns.push(mo.seekWidgetByName(this.ccsNode, "Button_tabSZNn"));
        for (var i = 0; i < this.mTabButtonNns.length; i++) {
            this.mTabButtonNns[i].setTag(i);
            this.mTabButtonNns[i].addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    this.intoTabIndexNn(sender.getTag());
                }
            }, this);
        }

        //tab Gsbdx
        this.mTabButtonGsbdxs = [];
        this.mTabButtonGsbdxs.push(mo.seekWidgetByName(this.ccsNode, "Button_tabDzGsbdx"));
        this.mTabButtonGsbdxs.push(mo.seekWidgetByName(this.ccsNode, "Button_tabHnGsbdx"));
        for (var i = 0; i < this.mTabButtonGsbdxs.length; i++) {
            this.mTabButtonGsbdxs[i].setTag(i);
            this.mTabButtonGsbdxs[i].addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    this.intoTabIndexGsbdx(sender.getTag());
                }
            }, this);
        }
        //tab Psz
        this.mTabButtonPszs = [];
        this.mTabButtonPszs.push(mo.seekWidgetByName(this.ccsNode, "Button_tabSzPsz"));
        this.mTabButtonPszs.push(mo.seekWidgetByName(this.ccsNode, "Button_tabDzPsz"));
        for (var i = 0; i < this.mTabButtonPszs.length; i++) {
            this.mTabButtonPszs[i].setTag(i);
            this.mTabButtonPszs[i].addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    this.intoTabIndexPsz(sender.getTag());
                }
            }, this);
        }

        //tab dtj
        this.mTabButtonDtj = [];
        this.mTabButtonDtj.push(mo.seekWidgetByName(this.ccsNode, "Button_taDpjDtj"));
        this.mTabButtonDtj.push(mo.seekWidgetByName(this.ccsNode, "Button_taXpjDtj"));
        this.mTabButtonDtj.push(mo.seekWidgetByName(this.ccsNode, "Button_taGpjDtj"));
        for (var i = 0; i < this.mTabButtonDtj.length; i++) {
            this.mTabButtonDtj[i].setTag(i);
            this.mTabButtonDtj[i].addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    this.intoTabIndexDtj(sender.getTag());
                }
            }, this);
        }


        this.loadRoomCreateUI();
        this.loadRoomCreateUINn();
        this.loadRoomCreateUIGsbdx();
        this.loadRoomCreateUIPsz();
        // this.loadRoomCreateUIWhmj();
        this.loadRoomCreateUIDzpk();
        this.loadRoomCreateUIDtj();
        this.loadRoomCreateUIPdk();

    },

    onEnter: function () {
        this._super();

        if (mo.gameHelper.projectCode != 2) {
            this.onIntoGameIndex(0);
        } else {
            this.onIntoGameIndex(4);
        }

        //加载游戏规则
        this.onLoadGameRuleConfig();

        //审核
        if (mo.gameHelper.isIosCheck) {
            mo.seekWidgetByName(this.ccsNode, "Panel_game").setVisible(false);
            mo.seekWidgetByName(this.ccsNode, "Button_yikai").setVisible(false);
            mo.seekWidgetByName(this.ccsNode, "Button_daikai").setVisible(false);
        }
    },

    setVisible: function (isVisible) {
        this._super(isVisible);
    },

    closeAction: function () {
        this.setVisible(false);
        // var isClose = false;
        //
        // //拦截
        // var currenttime = mo.gameHelper.getMillisecond();
        // if (currenttime - this.mTimestamp < 500){
        //     isClose = false;
        // }else{
        //     this.mTimestamp = currenttime;
        //
        //     var that = this;
        //     node.runAction(cc.sequence(cc.scaleTo(0.3, this.mActionScaleStart), cc.scaleTo(0.1, 0), cc.callFunc(function(){
        //         that.setVisible(false);
        //     })));
        //
        //     isClose = true;
        // }
        //
        // return isClose;
    },

    onLoadGameRuleConfig: function () {
        //kwx
        this.mTableConfig = mo.gameRoomRuleHelper.loadRuleConfig("kwx");
        // this.updateConfig();

        //nn
        this.mTableConfigNn = mo.gameRoomRuleHelper.loadRuleConfig("nn");
        // this.updateConfigNn();

        //gsbdx
        this.mTableConfigGsbdx = mo.gameRoomRuleHelper.loadRuleConfig("gsbdx");
        // this.updateConfigGsbdx();

        //psz
        this.mTableConfigPsz = mo.gameRoomRuleHelper.loadRuleConfig("psz");
        // this.updateConfigPsz();

        //whmj
        this.mTableConfigWhmj = mo.gameRoomRuleHelper.loadRuleConfig("whmj");
        // this.updateConfigWhmj();

        //dzpk
        this.mTableConfigDzpk = mo.gameRoomRuleHelper.loadRuleConfig("dzpk");

        //dtj
        this.mTableConfigDtj = mo.gameRoomRuleHelper.loadRuleConfig("dtj");

        //pdk
        this.mTableConfigPdk = mo.gameRoomRuleHelper.loadRuleConfig("pdk");

        //add

        if (mo.gameHelper.projectCode == 0) {
            this.updateConfig();
            this.updateConfigNn();
            this.updateConfigGsbdx();
            this.updateConfigPsz();
            // this.updateConfigWhmj();
            this.updateConfigDzpk();
            this.updateConfigDtj();
            this.updateConfigPdk();
        } else if (mo.gameHelper.projectCode == 1) {
            this.updateConfig();
            // this.updateConfigNn();
            // this.updateConfigGsbdx();
            this.updateConfigPsz();
            // this.updateConfigWhmj();
        } else if (mo.gameHelper.projectCode == 2) {
            this.updateConfig();
            this.updateConfigNn();
            // this.updateConfigGsbdx();
            this.updateConfigPsz();
            this.updateConfigWhmj();
            this.updateConfigDzpk();
        }
    },

    onIntoGameIndex: function (index) {
        this.mGameIndex = index;

        //title
        this.setTitleText("res/ccs/hall_second/roomCreateNew/title_" + this.mGameNames[index] + ".png");

        //ui
        this.Panel_gameKwx.setVisible(index == 0);
        this.Panel_gameNn.setVisible(index == 1);
        this.Panel_gameGsbdx.setVisible(index == 2);
        this.Panel_gamePsz.setVisible(index == 3);
        this.Panel_gameWhmj.setVisible(index == 4);
        this.Panel_gameDzpk.setVisible(index == 5);
        this.Panel_gameDtj.setVisible(index == 6);
        this.Panel_gamePdk.setVisible(index == 7);

        //封顶值
        var gameNames = this.mGameNames;
        var LODValues = mo.gameRoomRuleHelper.getLODValue(gameNames[index]);
        this.setLODValue(LODValues);
    },

    setLODValue: function (LODValues) {
        var checkBoxs = this.mCheckBoxs;

        for (var i = 0; i < 2; i++) {
            checkBoxs[i].setSelected(false);

            if (LODValues.length > i) {
                checkBoxs[i].setVisible(true);

                var Text_lod = mo.seekWidgetByName(checkBoxs[i], "Text_lod");
                var str = "封顶保护:" + LODValues[i];
                mo.gameHelper.setTextString(Text_lod, str);
            } else {
                checkBoxs[i].setVisible(false);
            }
        }


    },

    getLODNum: function (gameName) {
        var LODValues = mo.gameRoomRuleHelper.getLODValue(gameName);
        var selectIndex = -1;
        for (var i = 1; i >= 0; i--) {
            if (this.mCheckBoxs[i].isSelected()) {
                selectIndex = i;
                break;
            }
        }

        if (selectIndex == -1) {
            //未选择
            return 0;
        }

        if (LODValues.length < selectIndex) {
            //没有生死战模式
            return 0;
        }

        return LODValues[selectIndex];
    },

    getConfigForGameName: function (gameName) {
        var config = {};
        if (gameName == "kwx") {
            config = this.mTableConfig;
        } else if (gameName == "nn") {
            config = this.mTableConfigNn;
        } else if (gameName == "gsbdx") {
            config = this.mTableConfigGsbdx;
        } else if (gameName == "psz") {
            config = this.mTableConfigPsz;
        } else if (gameName == "whmj") {
            config = this.mTableConfigWhmj;
        } else if (gameName == "dzpk") {
            config = this.mTableConfigDzpk;
        } else if (gameName == "dtj") {
            config = this.mTableConfigDtj;
        } else if (gameName == "pdk") {
            config = this.mTableConfigPdk;
        } else {
        }

        return config;
    },

    loadRoomCreateUI: function () {

        //tab content
        this.mPanel_contents = [];
        for (var i = 0; i < 4; i++) {
            var Panel_content = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_content" + i);
            this.mPanel_contents.push(Panel_content);
        }

        ///touch
        //盘数
        var Panel_fanshu = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_fanshu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_fanshu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("maxpan")) {
                        this.mTableConfig.maxpan = (sender.getTag() == 0 ? 8 : 16);
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //人数
        var Panel_singleton = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_singleton");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_singleton, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("playerCount")) {
                        var temp = 0;
                        if (sender.getTag() == 0) {
                            temp = 3;
                        } else {
                            temp = 2;
                        }
                        this.mTableConfig.playerCount = temp;
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //番数加飘
        var Panel_jiapiao = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_jiapiao");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jiapiao, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("piao")) {
                        this.mTableConfig.piao = sender.getTag();
                        this.updateConfig();
                    }
                }
            }, this);
        }

        ///tab也不同 也不同
        //孝感
        //数坎
        var Panel_content0 = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_content0");
        var Panel_shukan = mo.seekWidgetByName(Panel_content0, "Panel_shukan");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_shukan, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("kan")) {
                        var isSelect = mo.seekWidgetByName(sender, "CheckBox").isSelected();
                        if (isSelect) {
                            this.mTableConfig.kan = 0;
                        } else {
                            this.mTableConfig.kan = sender.getTag() == 0 ? 1 : 2;
                        }
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //ting12
        var Panel_ting12 = mo.seekWidgetByName(Panel_content0, "Panel_ting12");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_ting12, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("ting12")) {
                        this.mTableConfig.ting12 = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //16番
        var Panel_maxfan = mo.seekWidgetByName(Panel_content0, "Panel_maxfan");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_maxfan, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("alltop")) {
                        this.mTableConfig.alltop = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 8 : 16;
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //买马xg
        var Panel_maima_xg = mo.seekWidgetByName(Panel_content0, "Panel_maima_xg");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_maima_xg, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("horse")) {
                        this.mTableConfig.horse = sender.getTag();
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //襄阳
        //买马3
        var Panel_content1 = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_content1");
        var Panel_maima3 = mo.seekWidgetByName(Panel_content1, "Panel_maima3");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_maima3, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("horse")) {
                        this.mTableConfig.horse = sender.getTag();
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //频道
        var Panel_pd = mo.seekWidgetByName(Panel_content1, "Panel_pd");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_pd, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("pd")) {
                        this.mTableConfig.pd = sender.getTag();
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //十堰
        //上楼
        var Panel_content2 = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_content2");
        var Panel_shanglou = mo.seekWidgetByName(Panel_content2, "Panel_shanglou");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_shanglou, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("sl")) {
                        this.mTableConfig.sl = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;
                        this.updateConfig();
                    }

                }
            }, this);
        }

        //查叫
        var Panel_chajiao = mo.seekWidgetByName(Panel_content2, "Panel_chajiao");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_chajiao, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("cj")) {
                        this.mTableConfig.cj = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;
                        this.updateConfig();
                    }

                }
            }, this);
        }

        //频道
        var Panel_pd_sy = mo.seekWidgetByName(Panel_content2, "Panel_pd_sy");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_pd_sy, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("pd")) {
                        this.mTableConfig.pd = sender.getTag();
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //买马3
        var Panel_maima_sy = mo.seekWidgetByName(Panel_content2, "Panel_maima_sy");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_maima_sy, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("horse")) {
                        this.mTableConfig.horse = sender.getTag();
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //随州
        //买马2
        var Panel_content3 = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_content3");
        var Panel_maima2 = mo.seekWidgetByName(Panel_content3, "Panel_maima2");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_maima2, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("horse")) {
                        this.mTableConfig.horse = sender.getTag() + 1;
                        this.updateConfig();
                    }
                }
            }, this);
        }

        var Panel_maimaRule = mo.seekWidgetByName(Panel_content3, "Panel_maimaRule");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_maimaRule, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfig.hasOwnProperty("zm")) {
                        this.mTableConfig.zm = sender.getTag();
                        this.updateConfig();
                    }
                }
            }, this);
        }

        //买马规则
        for (var m = 0; m < 4; m++) {
            var Panel_content = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_content" + m);
            var Panel_maimaRule = mo.seekWidgetByName(Panel_content, "Panel_maimaRule");
            for (var i = 0; i < 2; i++) {
                var Panel_item = mo.seekWidgetByName(Panel_maimaRule, "Panel_item" + i);
                Panel_item.setTag(i);
                Panel_item.addTouchEventListener(function (sender, type) {
                    if (mo.gameHelper.getIsTouchEnd(type)) {
                        if (this.mTableConfig.hasOwnProperty("zm")) {
                            this.mTableConfig.zm = sender.getTag();
                            this.updateConfig();
                        }
                    }
                }, this);
            }
        }
    },

    loadRoomCreateUINn: function () {
        //nn
        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameNn, "Panel_jushu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jushu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigNn.hasOwnProperty("maxpan")) {
                        this.mTableConfigNn.maxpan = (sender.getTag() == 0 ? 10 : 20);
                        this.updateConfigNn();
                    }
                }
            }, this);
        }

        //庄
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameNn, "Panel_wanfa");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_wanfa, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigNn.hasOwnProperty("hosttype")) {
                        this.mTableConfigNn.hosttype = sender.getTag();
                        this.updateConfigNn();
                    }
                }
            }, this);
        }

        //扣
        var Panel_quankou = mo.seekWidgetByName(this.Panel_gameNn, "Panel_quankou");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_quankou, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigNn.hasOwnProperty("kou")) {
                        this.mTableConfigNn.kou = sender.getTag();
                        this.updateConfigNn();
                    }
                }
            }, this);
        }

        //选分
        var Panel_xuanfen = mo.seekWidgetByName(this.Panel_gameNn, "Panel_xuanfen");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_xuanfen, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigNn.hasOwnProperty("addratetime")) {
                        var value = 0;
                        if (sender.getTag() == 0) {
                            value = 0;
                        } else if (sender.getTag() == 1) {
                            value = 2;
                        }
                        this.mTableConfigNn.addratetime = value;
                        this.updateConfigNn();
                    }
                }
            }, this);
        }

        //加倍
        var Panel_quankou = mo.seekWidgetByName(this.Panel_gameNn, "Panel_jiabei");
        for (var i = 0; i < 4; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_quankou, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigNn.hasOwnProperty("basepoint")) {
                        var value = 3;
                        if (sender.getTag() == 0) {
                            value = 3;
                        } else if (sender.getTag() == 1) {
                            value = 5;
                        } else if (sender.getTag() == 2) {
                            value = 7;
                        } else if (sender.getTag() == 3) {
                            value = 10;
                        }
                        this.mTableConfigNn.basepoint = value;
                        this.updateConfigNn();
                    }
                }
            }, this);
        }
    },

    loadRoomCreateUIGsbdx: function () {
        //gsbdx
        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_jushu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jushu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigGsbdx.hasOwnProperty("maxpan")) {
                        this.mTableConfigGsbdx.maxpan = (sender.getTag() == 0 ? 10 : 20);
                        this.updateConfigGsbdx();
                    }
                }
            }, this);
        }

        //庄
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_wanfa");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_wanfa, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigGsbdx.hasOwnProperty("hosttype")) {
                        this.mTableConfigGsbdx.hosttype = sender.getTag();
                        this.updateConfigGsbdx();
                    }
                }
            }, this);
        }

        //选分
        var Panel_xuanfen = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_xuanfen");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_xuanfen, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigGsbdx.hasOwnProperty("addratetime")) {
                        var value = 0;
                        if (sender.getTag() == 0) {
                            value = 0;
                        } else if (sender.getTag() == 1) {
                            value = 2;
                        }
                        this.mTableConfigGsbdx.addratetime = value;
                        this.updateConfigGsbdx();
                    }
                }
            }, this);
        }

        //加倍
        var Panel_quankou = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_jiabei");
        for (var i = 0; i < 4; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_quankou, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigGsbdx.hasOwnProperty("basepoint")) {
                        var value = 3;
                        if (sender.getTag() == 0) {
                            value = 3;
                        } else if (sender.getTag() == 1) {
                            value = 5;
                        } else if (sender.getTag() == 2) {
                            value = 7;
                        } else if (sender.getTag() == 3) {
                            value = 10;
                        }
                        this.mTableConfigGsbdx.basepoint = value;
                        this.updateConfigGsbdx();
                    }
                }
            }, this);
        }
    },

    loadRoomCreateUIWhmj: function () {
        //whmj
        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_jushu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jushu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigWhmj.hasOwnProperty("maxpan")) {
                        this.mTableConfigWhmj.maxpan = (sender.getTag() == 0 ? 6 : 12);
                        this.updateConfigWhmj();
                    }
                }
            }, this);
        }

        //规则id 1:红中发财杠 2:赖子皮杠
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_wanfa");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_wanfa, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigWhmj.hasOwnProperty("ruleid")) {
                        this.mTableConfigWhmj.ruleid = sender.getTag() + 1;
                        this.updateConfigWhmj();
                    }
                }
            }, this);
        }

        //openrate 1:开口番  2:口口番
        var Panel_openRate = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_openRate");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_openRate, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigWhmj.hasOwnProperty("openrate")) {
                        this.mTableConfigWhmj.openrate = sender.getTag() + 1;
                        this.updateConfigWhmj();
                    }
                }
            }, this);
        }

        //huscore 1:16分  2:32分
        var Panel_huScore = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_huScore");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_huScore, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigWhmj.hasOwnProperty("huscore")) {
                        this.mTableConfigWhmj.huscore = (sender.getTag() + 1) * 16;
                        this.updateConfigWhmj();
                    }
                }
            }, this);
        }

        //原赖翻番 0:不翻番  1:翻番
        var Panel_yl = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_yl");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_yl, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigWhmj.hasOwnProperty("yl")) {
                        this.mTableConfigWhmj.yl = sender.getTag();
                        this.updateConfigWhmj();
                    }
                }
            }, this);
        }

        //风赖翻番 0:不翻番  1:翻番
        var Panel_fl = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_fl");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_fl, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigWhmj.hasOwnProperty("fl")) {
                        this.mTableConfigWhmj.fl = sender.getTag();
                        this.updateConfigWhmj();
                    }
                }
            }, this);
        }
    },

    loadRoomCreateUIPsz: function () {
        //psz
        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_jushu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jushu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPsz.hasOwnProperty("maxpan")) {

                        var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
                        this.mTableConfigPsz.maxpan = rules.maxpan[sender.getTag()];
                        this.updateConfigPsz();
                    }
                }
            }, this);
        }

        //封顶开牌
        var Panel_fengding = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_fengding");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_fengding, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPsz.hasOwnProperty("open")) {

                        var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
                        this.mTableConfigPsz.open = rules.open[sender.getTag()];
                        this.updateConfigPsz();
                    }
                }
            }, this);
        }

        //比牌轮数
        var Panel_bipai = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_bipai");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_bipai, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPsz.hasOwnProperty("bi")) {

                        var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
                        this.mTableConfigPsz.bi = rules.bi[sender.getTag()];
                        this.updateConfigPsz();
                    }
                }
            }, this);
        }

        //闷牌
        var Panel_menpai = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_menpai");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_menpai, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPsz.hasOwnProperty("men")) {

                        var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
                        this.mTableConfigPsz.men = rules.men[sender.getTag()];
                        this.updateConfigPsz();
                    }
                }
            }, this);
        }

        //豹子奖励
        var Panel_aaap = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_aaap");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_aaap, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPsz.hasOwnProperty("aaap")) {

                        var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
                        this.mTableConfigPsz.aaap = rules.aaap[sender.getTag()];
                        this.updateConfigPsz();
                    }
                }
            }, this);
        }

        //比牌规则
        var Panel_ssc = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_ssc");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_ssc, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPsz.hasOwnProperty("ssc")) {

                        this.mTableConfigPsz.ssc = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;
                        this.updateConfigPsz();
                    }
                }
            }, this);
        }
    },

    loadRoomCreateUIDzpk: function () {
        //dzpk
        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameDzpk, "Panel_jushu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jushu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDzpk.hasOwnProperty("maxpan")) {
                        this.mTableConfigDzpk.maxpan = (sender.getTag() == 0 ? 5 : 10);
                        this.updateConfigDzpk();
                    }
                }
            }, this);
        }

        //大盲注
        var Panel_basepoint = mo.seekWidgetByName(this.Panel_gameDzpk, "Panel_basepoint");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_basepoint, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDzpk.hasOwnProperty("basepoint")) {
                        this.mTableConfigDzpk.basepoint = (sender.getTag() == 0 ? 2 : 6);
                        this.updateConfigDzpk();
                    }
                }
            }, this);
        }

        //闷
        var Panel_men = mo.seekWidgetByName(this.Panel_gameDzpk, "Panel_men");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_men, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDzpk.hasOwnProperty("men")) {
                        this.mTableConfigDzpk.men = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;
                        this.updateConfigDzpk();
                    }
                }
            }, this);
        }
    },

    loadRoomCreateUIDtj: function () {
        //dtj

        var Panel_xuguo = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_xuguo");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_xuguo, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("xuguo")) {
                        this.mTableConfigDtj.xuguo = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;
                        this.updateConfigDtj();
                    }
                }
            }, this);
        }

        //锅的底分
        var Panel_guoMax = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_guoMax");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_guoMax, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("guomax")) {
                        var value = 0;
                        if (sender.getTag() == 0) {
                            value = 60;
                        } else if (sender.getTag() == 1) {
                            value = 80;
                        } else if (sender.getTag() == 2) {
                            value = 100;
                        }
                        this.mTableConfigDtj.guomax = value;
                        this.updateConfigDtj();
                    }
                }
            }, this);
        }


        //玩法选择
        var Panel_paijiu = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_paijiu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_paijiu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("paijiu")) {
                        this.mTableConfigDtj.paijiu = (sender.getTag() == 0 ? 0 : 1);
                        this.updateConfigDtj();
                    }
                }
            }, this);
        }

        //牌型选择
        var Panel_gz = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_gz");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_gz, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("ruleid")) {
                        var tjw = (this.mTableConfigDtj.ruleid == 1 || this.mTableConfigDtj.ruleid == 4) ? 1 : 0;
                        var gz = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;

                        if (gz == 1 && tjw == 1) {
                            this.mTableConfigDtj.ruleid = 1;
                        } else if (gz == 0 && tjw == 0) {
                            this.mTableConfigDtj.ruleid = 2;
                        } else if (gz == 1 && tjw == 0) {
                            this.mTableConfigDtj.ruleid = 3;
                        } else if (gz == 0 && tjw == 1) {
                            this.mTableConfigDtj.ruleid = 4;
                        }

                        this.updateConfigDtj();
                    }
                }
            }, this);
        }

        var Panel_tjw = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_tjw");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_tjw, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("ruleid")) {
                        var gz = (this.mTableConfigDtj.ruleid == 1 || this.mTableConfigDtj.ruleid == 3) ? 1 : 0;
                        var tjw = mo.seekWidgetByName(sender, "CheckBox").isSelected() ? 0 : 1;

                        if (gz == 1 && tjw == 1) {
                            this.mTableConfigDtj.ruleid = 1;
                        } else if (gz == 0 && tjw == 0) {
                            this.mTableConfigDtj.ruleid = 2;
                        } else if (gz == 1 && tjw == 0) {
                            this.mTableConfigDtj.ruleid = 3;
                        } else if (gz == 0 && tjw == 1) {
                            this.mTableConfigDtj.ruleid = 4;
                        }

                        this.updateConfigDtj();
                    }
                }
            }, this);
        }

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jushu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("maxpan")) {
                        this.mTableConfigDtj.maxpan = (sender.getTag() == 0 ? 12 : 24);
                        this.updateConfigDtj();
                    }
                }
            }, this);
        }

        //庄
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_wanfa");
        for (var i = 0; i < 3; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_wanfa, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("hosttype")) {
                        this.mTableConfigDtj.hosttype = sender.getTag();
                        this.updateConfigDtj();
                    }
                }
            }, this);
        }

        //选分
        var Panel_xuanfen = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_xuanfen");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_xuanfen, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("addratetime")) {
                        var value = 0;
                        if (sender.getTag() == 0) {
                            value = 0;
                        } else if (sender.getTag() == 1) {
                            value = 2;
                        }
                        this.mTableConfigDtj.addratetime = value;
                        this.updateConfigDtj();
                    }
                }
            }, this);
        }

        //加倍
        var Panel_jiabei = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jiabei");
        for (var i = 0; i < 5; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jiabei, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigDtj.hasOwnProperty("basepoint")) {
                        var value = 2;
                        if (sender.getTag() == 0) {
                            value = 1;
                        } else if (sender.getTag() == 1) {
                            value = 2;
                        } else if (sender.getTag() == 2) {
                            value = 5;
                        } else if (sender.getTag() == 3) {
                            value = 8;
                        } else if (sender.getTag() == 4) {
                            value = 10;
                        }
                        this.mTableConfigDtj.basepoint = value;
                        this.updateConfigDtj();
                    }
                }
            }, this);
        }
    },

    loadRoomCreateUIPdk: function () {
        //pdk
        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_jushu");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_jushu, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPdk.hasOwnProperty("maxpan")) {
                        this.mTableConfigPdk.maxpan = (sender.getTag() == 0 ? 2 : 12);
                        this.updateConfigPdk();
                    }
                }
            }, this);
        }

        //先出牌
        var Panel_hosttype = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_hosttype");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_hosttype, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPdk.hasOwnProperty("hosttype")) {
                        var index = sender.getTag();
                        var value = index;
                        this.mTableConfigPdk.hosttype = value;
                        this.updateConfigPdk();
                    }
                }
            }, this);
        }

        //封顶
        var Panel_alltop = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_alltop");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_alltop, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPdk.hasOwnProperty("alltop")) {
                        var index = sender.getTag();
                        var value = index;
                        this.mTableConfigPdk.alltop = value;
                        this.updateConfigPdk();
                    }
                }
            }, this);
        }

        //规则三带
        var Panel_ruleTriple = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_ruleTriple");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_ruleTriple, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPdk.hasOwnProperty("ruletriple")) {
                        var index = sender.getTag();
                        var value = index;
                        this.mTableConfigPdk.ruletriple = value;
                        this.updateConfigPdk();
                    }
                }
            }, this);
        }

        //规则飞机
        var Panel_ruleAirplane = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_ruleAirplane");
        for (var i = 0; i < 2; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_ruleAirplane, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPdk.hasOwnProperty("ruleairplane")) {
                        var index = sender.getTag();
                        var value = index;
                        this.mTableConfigPdk.ruleairplane = value;
                        this.updateConfigPdk();
                    }
                }
            }, this);
        }

        //规则四带
        var Panel_ruleFour = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_ruleFour");
        for (var i = 0; i < 1; i++) {
            var Panel_item = mo.seekWidgetByName(Panel_ruleFour, "Panel_item" + i);
            Panel_item.setTag(i);
            Panel_item.addTouchEventListener(function (sender, type) {
                if (mo.gameHelper.getIsTouchEnd(type)) {
                    if (this.mTableConfigPdk.hasOwnProperty("rulefour")) {
                        var isSelect = mo.seekWidgetByName(sender, "CheckBox").isSelected();
                        var value = isSelect ? 1 : 0;
                        this.mTableConfigPdk.rulefour = value;
                        this.updateConfigPdk();
                    }
                }
            }, this);
        }
    },

    intoTabIndex: function (index) {
        this.mTableConfig = mo.gameRoomRuleHelper.loadKwxRuleConfig(index);

        this.updateConfig();
    },

    intoTabIndexNn: function (index) {
        this.mTableConfigNn = mo.gameRoomRuleHelper.loadNnRuleConfig(index);

        this.updateConfigNn();
    },

    intoTabIndexGsbdx: function (index) {
        this.mTableConfigGsbdx = mo.gameRoomRuleHelper.loadGsbdxRuleConfig(index);

        this.updateConfigGsbdx();
    },

    intoTabIndexPsz: function (index) {
        this.mTableConfigPsz = mo.gameRoomRuleHelper.loadPszRuleConfig(index);

        this.updateConfigPsz();
    },

    intoTabIndexDtj: function (index) {
        this.mTableConfigDtj = mo.gameRoomRuleHelper.loadDtjRuleConfig(index);

        this.updateConfigDtj();
    },

    updateConfig: function () {
        var config = this.mTableConfig;
        var index = config.ruleid - 1;
        for (var i = 0; i < 4; i++) {
            this.mPanel_contents[i].setVisible(index == i);
        }
        var panel_content = this.mPanel_contents[index];

        //index tag
        if (config.hasOwnProperty("ruleid")) {
            var tabIndex = config.ruleid - 1;
            var normals = ["res/ccs/hall_second/roomCreate/wanfa_xiaogan_n.png",
                "res/ccs/hall_second/roomCreate/wanfa_xiagyang_n.png",
                "res/ccs/hall_second/roomCreate/wanfa_shiyan_n.png",
                "res/ccs/hall_second/roomCreate/wanfa_suizhou_n.png"
            ];

            var selects = ["res/ccs/hall_second/roomCreate/wanfa_xiaogan_s.png",
                "res/ccs/hall_second/roomCreate/wanfa_xiagyang_s.png",
                "res/ccs/hall_second/roomCreate/wanfa_shiyan_s.png",
                "res/ccs/hall_second/roomCreate/wanfa_suizhou_s.png"
            ];

            for (var i = 0; i < 4; i++) {
                // this.mTabButtons[i].ignoreContentAdaptWithSize(false);
                // this.mTabButtons[i].ignoreContentAdaptWithSize(true);
                this.mTabButtons[i].loadTextureNormal(tabIndex == i ? selects[i] : normals[i]);
                this.mTabButtons[i].setLocalZOrder(tabIndex == i ? 1 : -1);

                if (mo.gameHelper.projectCode == 0) {
                    // this.mTabButtons[i].setPositionX(tabIndex == i ? -325.00 : -335.00);
                    // this.mTabButtons[i].setContentSize(tabIndex == i ? cc.size(179, 73) : cc.size(125, 73));
                } else if (mo.gameHelper.projectCode == 1) {
                    this.mTabButtons[i].setContentSize(cc.size(208, 84));
                } else if (mo.gameHelper.projectCode == 2) {


                }
            }
        }

        //盘数
        var Panel_fanshu = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_fanshu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var index = -1;
            if (value == 8) {
                index = 0;
            } else if (value == 16) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_fanshu, index);
        }

        //人数
        var Panel_singleton = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_singleton");
        if (config.hasOwnProperty("playerCount")) {
            var value = config.playerCount;
            var index = -1;
            if (value == 3) {
                index = 0;
            } else if (value == 2) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_singleton, index);
        } else {
            this.setCheckBoxSelect(Panel_singleton, -1);
        }

        //加飘
        var Panel_jiapiao = mo.seekWidgetByName(this.Panel_gameKwx, "Panel_jiapiao");
        if (config.hasOwnProperty("piao")) {
            var value = config.piao;
            var index = -1;
            if (value == 0) {
                index = 0;
            } else if (value == 1) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_jiapiao, index);
        } else {
            this.setCheckBoxSelect(Panel_jiapiao, -1);
        }

        //tags
        //数坎
        var Panel_shukan = mo.seekWidgetByName(panel_content, "Panel_shukan");
        if (Panel_shukan) {
            if (config.hasOwnProperty("kan")) {
                var value = config.kan;
                var index = value - 1;
                this.setCheckBoxSelect(Panel_shukan, index);
            } else {
                this.setCheckBoxSelect(Panel_shukan, -1);
            }
        }

        //ting12
        var Panel_ting12 = mo.seekWidgetByName(panel_content, "Panel_ting12");
        if (Panel_ting12) {
            if (config.hasOwnProperty("ting12")) {
                var value = config.ting12;
                var index = -1;
                if (value == 0) {
                    index = 1;
                } else if (value == 1) {
                    index = 0;
                }
                this.setCheckBoxSelect(Panel_ting12, index);
            } else {
                this.setCheckBoxSelect(Panel_ting12, -1);
            }
        }

        //16番
        var Panel_maxfan = mo.seekWidgetByName(panel_content, "Panel_maxfan");
        if (Panel_maxfan) {
            if (config.hasOwnProperty("alltop")) {
                var value = config.alltop;
                var index = -1;
                if (value == 16) {
                    index = 0;
                } else if (value == 8) {
                    index = -1;
                }
                this.setCheckBoxSelect(Panel_maxfan, index);
            } else {
                this.setCheckBoxSelect(Panel_maxfan, -1);
            }
        }

        //买马xg
        var Panel_maima_xg = mo.seekWidgetByName(panel_content, "Panel_maima_xg");
        if (Panel_maima_xg) {
            if (config.hasOwnProperty("horse")) {
                var value = config.horse;
                var index = -1;
                if (value == 0) {
                    index = 0;
                } else if (value == 1) {
                    index = 1;
                } else if (value == 2) {
                    index = 2;
                }
                this.setCheckBoxSelect(Panel_maima_xg, index);
            } else {
                this.setCheckBoxSelect(Panel_maima_xg, -1);
            }
        }

        //买马3
        var Panel_maima3 = mo.seekWidgetByName(panel_content, "Panel_maima3");
        if (Panel_maima3) {
            if (config.hasOwnProperty("horse")) {
                var value = config.horse;
                var index = -1;
                if (value == 0) {
                    index = 0;
                } else if (value == 1) {
                    index = 1;
                } else if (value == 2) {
                    index = 2;
                }
                this.setCheckBoxSelect(Panel_maima3, index);
            } else {
                this.setCheckBoxSelect(Panel_maima3, -1);
            }
        }

        //频道
        var Panel_pd = mo.seekWidgetByName(panel_content, "Panel_pd");
        if (Panel_pd) {
            if (config.hasOwnProperty("pd")) {
                var value = config.pd;
                var index = value;
                this.setCheckBoxSelect(Panel_pd, index);
            } else {
                this.setCheckBoxSelect(Panel_pd, -1);
            }
        }

        //上楼
        var Panel_shanglou = mo.seekWidgetByName(panel_content, "Panel_shanglou");
        if (Panel_shanglou) {
            if (config.hasOwnProperty("sl")) {
                var value = config.sl;
                var index = (value == 1 ? 0 : 1);
                this.setCheckBoxSelect(Panel_shanglou, index);
            } else {
                this.setCheckBoxSelect(Panel_shanglou, -1);
            }
        }

        //查叫
        var Panel_chajiao = mo.seekWidgetByName(panel_content, "Panel_chajiao");
        if (Panel_chajiao) {
            if (config.hasOwnProperty("cj")) {
                var value = config.cj;
                var index = (value == 1 ? 0 : 1);
                this.setCheckBoxSelect(Panel_chajiao, index);
            } else {
                this.setCheckBoxSelect(Panel_chajiao, -1);
            }
        }

        //频道 十堰
        var Panel_pd_sy = mo.seekWidgetByName(panel_content, "Panel_pd_sy");
        if (Panel_pd_sy) {
            if (config.hasOwnProperty("pd")) {
                var value = config.pd;
                var index = value;
                this.setCheckBoxSelect(Panel_pd_sy, index);
            } else {
                this.setCheckBoxSelect(Panel_pd_sy, -1);
            }
        }

        //买马 sy
        var Panel_maima_sy = mo.seekWidgetByName(panel_content, "Panel_maima_sy");
        if (Panel_maima_sy) {
            if (config.hasOwnProperty("horse")) {
                var value = config.horse;
                var index = -1;
                if (value == 0) {
                    index = 0;
                } else if (value == 1) {
                    index = 1;
                } else if (value == 2) {
                    index = 2;
                }
                this.setCheckBoxSelect(Panel_maima_sy, index);
            } else {
                this.setCheckBoxSelect(Panel_maima_sy, -1);
            }
        }

        //买马2
        var Panel_maima2 = mo.seekWidgetByName(panel_content, "Panel_maima2");
        if (Panel_maima2) {
            if (config.hasOwnProperty("horse")) {
                var value = config.horse;
                var index = -1;
                if (value == 1) {
                    index = 0;
                } else if (value == 2) {
                    index = 1;
                }
                this.setCheckBoxSelect(Panel_maima2, index);
            } else {
                this.setCheckBoxSelect(Panel_maima2, -1);
            }
        }

        //买马规则
        var Panel_maimaRule = mo.seekWidgetByName(panel_content, "Panel_maimaRule");
        if (Panel_maimaRule) {
            //是否显示
            if (config.hasOwnProperty("horse")) {
                Panel_maimaRule.setVisible(config.horse != 0);
            }

            //买马规则
            if (config.hasOwnProperty("zm")) {
                var value = config.zm;
                var index = value;
                this.setCheckBoxSelect(Panel_maimaRule, index);
            } else {
                this.setCheckBoxSelect(Panel_maimaRule, -1);
            }
        }
    },

    updateConfigNn: function () {
        var config = this.mTableConfigNn;

        //index tag
        if (config.hasOwnProperty("ruleid")) {
            var tabIndex = config.ruleid - 1;

            var normals = ["res/ccs/hall_second/roomCreate/wanfa_dazhong_n.png",
                "res/ccs/hall_second/roomCreate/wanfa_suizhou_n.png"
            ];

            var selects = ["res/ccs/hall_second/roomCreate/wanfa_dazhong_s.png",
                "res/ccs/hall_second/roomCreate/wanfa_suizhou_s.png"
            ];

            for (var i = 0; i < 2; i++) {
                // this.mTabButtonNns[i].ignoreContentAdaptWithSize(false);
                // this.mTabButtonNns[i].ignoreContentAdaptWithSize(true);
                this.mTabButtonNns[i].loadTextureNormal(tabIndex == i ? selects[i] : normals[i]);
                this.mTabButtonNns[i].setLocalZOrder(tabIndex == i ? 1 : -1);

                if (mo.gameHelper.projectCode == 0) {
                    // this.mTabButtonNns[i].setPositionX(tabIndex == i ? -325.00 : -335.00);
                    // this.mTabButtonNns[i].setContentSize(tabIndex == i ? cc.size(179, 73) : cc.size(125, 73));
                } else if (mo.gameHelper.projectCode == 1) {
                    this.mTabButtonNns[i].setPositionX(tabIndex == i ? -334.00 : -349.00);
                    this.mTabButtonNns[i].setContentSize(cc.size(208, 84));
                } else if (mo.gameHelper.projectCode == 2) {

                }
            }
        }

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameNn, "Panel_jushu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var index = -1;
            if (value == 10) {
                index = 0;
            } else if (value == 20) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_jushu, index);
        }

        //连庄
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameNn, "Panel_wanfa");
        if (config.hasOwnProperty("hosttype")) {
            var value = config.hosttype;
            var index = value;
            this.setCheckBoxSelect(Panel_wanfa, index);
        }

        //扣
        var Panel_quankou = mo.seekWidgetByName(this.Panel_gameNn, "Panel_quankou");
        if (config.hasOwnProperty("kou")) {
            var value = config.kou;
            var index = value;
            this.setCheckBoxSelect(Panel_quankou, index);
        }

        //加倍
        var Panel_jiabei = mo.seekWidgetByName(this.Panel_gameNn, "Panel_jiabei");
        if (config.hasOwnProperty("basepoint")) {
            var value = config.basepoint;
            var index = 0;
            if (value == 3) {
                index = 0;
            } else if (value == 5) {
                index = 1;
            } else if (value == 7) {
                index = 2;
            } else if (value == 10) {
                index = 3;
            }
            this.setCheckBoxSelect(Panel_jiabei, index);
        }

        //选分
        var Panel_xuanfen = mo.seekWidgetByName(this.Panel_gameNn, "Panel_xuanfen");
        if (config.hasOwnProperty("addratetime")) {
            var value = config.addratetime;
            var index = 0;
            if (value == 0) {
                index = 0;
                Panel_jiabei.setVisible(false);
            } else {
                index = 1;
                Panel_jiabei.setVisible(true);
            }

            this.setCheckBoxSelect(Panel_xuanfen, index);
        }
    },

    updateConfigGsbdx: function () {
        var config = this.mTableConfigGsbdx;

        //index tag
        if (config.hasOwnProperty("ruleid")) {
            var tabIndex = (config.ruleid == 1 ? 0 : 1);

            var normals = ["res/ccs/hall_second/roomCreate/wanfa_dazhong_n.png",
                "res/ccs/hall_second/roomCreate/wanfa_henan_n.png"
            ];

            var selects = ["res/ccs/hall_second/roomCreate/wanfa_dazhong_s.png",
                "res/ccs/hall_second/roomCreate/wanfa_henan_s.png"
            ];

            for (var i = 0; i < 2; i++) {
                this.mTabButtonGsbdxs[i].loadTextureNormal(tabIndex == i ? selects[i] : normals[i]);
                this.mTabButtonGsbdxs[i].setLocalZOrder(tabIndex == i ? 1 : -1);

                if (mo.gameHelper.projectCode == 0) {
                    // this.mTabButtonGsbdxs[i].setPositionX(tabIndex == i ? -325.00 : -335.00);
                    // this.mTabButtonGsbdxs[i].setContentSize(tabIndex == i ? cc.size(179, 73) : cc.size(125, 73));
                } else if (mo.gameHelper.projectCode == 1) {
                    this.mTabButtonGsbdxs[i].setPositionX(tabIndex == i ? -334.00 : -349.00);
                    this.mTabButtonGsbdxs[i].setContentSize(cc.size(208, 84));
                } else if (mo.gameHelper.projectCode == 2) {

                }
            }
        }

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_jushu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var index = -1;
            if (value == 10) {
                index = 0;
            } else if (value == 20) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_jushu, index);
        }

        //连庄
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_wanfa");
        if (config.hasOwnProperty("hosttype")) {
            var value = config.hosttype;
            var index = value;
            this.setCheckBoxSelect(Panel_wanfa, index);
        }

        //加倍
        var Panel_jiabei = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_jiabei");
        if (config.hasOwnProperty("basepoint")) {
            var value = config.basepoint;
            var index = 0;
            if (value == 3) {
                index = 0;
            } else if (value == 5) {
                index = 1;
            } else if (value == 7) {
                index = 2;
            } else if (value == 10) {
                index = 3;
            }
            this.setCheckBoxSelect(Panel_jiabei, index);
        }

        //选分
        var Panel_xuanfen = mo.seekWidgetByName(this.Panel_gameGsbdx, "Panel_xuanfen");
        if (config.hasOwnProperty("addratetime")) {
            var value = config.addratetime;
            var index = 0;
            if (value == 0) {
                index = 0;
                Panel_jiabei.setVisible(false);
            } else {
                index = 1;
                Panel_jiabei.setVisible(true);
            }

            this.setCheckBoxSelect(Panel_xuanfen, index);
        }
    },

    updateConfigWhmj: function () {
        var config = this.mTableConfigWhmj;

        //1:开口翻 2:口口翻
        var Panel_openRate = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_openRate");
        if (config.hasOwnProperty("openrate")) {
            var value = config.openrate;
            var index = -1;
            if (value == 1) {
                index = 0;
            } else if (value == 2) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_openRate, index);
        }

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_jushu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var index = -1;
            if (value == 6) {
                index = 0;
            } else if (value == 12) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_jushu, index);
        }


        //规则id 1:红中发财杠 2:赖子皮杠
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_wanfa");
        if (config.hasOwnProperty("ruleid")) {
            var value = config.ruleid;
            var index = -1;
            if (value == 1) {
                index = 0;
            } else if (value == 2) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_wanfa, index);
        }

        //起胡分数 16,32.
        var Panel_huScore = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_huScore");
        if (config.hasOwnProperty("huscore")) {
            var value = config.huscore;
            var index = -1;
            if (value == 16) {
                index = 0;
            } else if (value == 32) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_huScore, index);
        }

        //0:无 1:原赖翻番.
        var Panel_yl = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_yl");
        if (config.hasOwnProperty("yl")) {
            var value = config.yl;
            var index = -1;
            if (value == 0) {
                index = 0;
            } else if (value == 1) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_yl, index);
        }

        //0:无 1:风赖翻番.
        var Panel_fl = mo.seekWidgetByName(this.Panel_gameWhmj, "Panel_fl");
        if (config.hasOwnProperty("fl")) {
            var value = config.fl;
            var index = -1;
            if (value == 0) {
                index = 0;
            } else if (value == 1) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_fl, index);
        }

    },

    updateConfigPsz: function () {
        var config = this.mTableConfigPsz;

        //index tag
        if (config.hasOwnProperty("ruleid")) {
            var tabIndex = config.ruleid - 1;

            var normals = ["res/ccs/hall_second/roomCreate/wanfa_suizhou_n.png",
                "res/ccs/hall_second/roomCreate/wanfa_dazhong_n.png"
            ];

            var selects = ["res/ccs/hall_second/roomCreate/wanfa_suizhou_s.png",
                "res/ccs/hall_second/roomCreate/wanfa_dazhong_s.png"
            ];

            for (var i = 0; i < 2; i++) {
                this.mTabButtonPszs[i].loadTextureNormal(tabIndex == i ? selects[i] : normals[i]);
                this.mTabButtonPszs[i].setLocalZOrder(tabIndex == i ? 1 : -1);

                if (mo.gameHelper.projectCode == 0) {
                    // this.mTabButtonPszs[i].setPositionX(tabIndex == i ? -325.00 : -335.00);
                    // this.mTabButtonPszs[i].setContentSize(tabIndex == i ? cc.size(179, 73) : cc.size(125, 73));
                } else if (mo.gameHelper.projectCode == 1) {
                    this.mTabButtonPszs[i].setPositionX(tabIndex == i ? -334.00 : -349.00);
                    this.mTabButtonPszs[i].setContentSize(cc.size(208, 84));
                } else if (mo.gameHelper.projectCode == 2) {

                }
            }

            //豹子奖励
            var Panel_aaap = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_aaap");
            mo.seekWidgetByName(Panel_aaap, "Panel_item0").setVisible(true);
            mo.seekWidgetByName(Panel_aaap, "Panel_item1").setVisible(tabIndex == 1);
            mo.seekWidgetByName(Panel_aaap, "Panel_item2").setVisible(tabIndex == 1);

            //显示规则文字
            var setItemTextFunc = function (panel, rules, danwei) {
                for (var i = 0; i < rules.length; i++) {
                    var rule = rules[i];
                    var Text_text = mo.seekWidgetByName(mo.seekWidgetByName(panel, "Panel_item" + i), "Text_text");
                    mo.gameHelper.setTextString(Text_text, rule + danwei);
                }
            };

            //封顶开牌
            setItemTextFunc(
                mo.seekWidgetByName(this.Panel_gamePsz, "Panel_fengding"),
                mo.gameRoomRuleHelper.getPszRuleStruct(config).open,
                "轮"
            );

            //比牌轮数
            setItemTextFunc(
                mo.seekWidgetByName(this.Panel_gamePsz, "Panel_bipai"),
                mo.gameRoomRuleHelper.getPszRuleStruct(config).bi,
                "轮"
            );

            //闷牌轮数
            setItemTextFunc(
                mo.seekWidgetByName(this.Panel_gamePsz, "Panel_menpai"),
                mo.gameRoomRuleHelper.getPszRuleStruct(config).men,
                "轮"
            );

            //豹子奖励
            setItemTextFunc(
                mo.seekWidgetByName(this.Panel_gamePsz, "Panel_aaap"),
                mo.gameRoomRuleHelper.getPszRuleStruct(config).aaap,
                "分"
            );
        }

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_jushu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
            var index = mo.gameHelper.findValueForArray(rules.maxpan, value);

            this.setCheckBoxSelect(Panel_jushu, index);
        }

        //封顶开牌
        var Panel_fengding = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_fengding");
        if (config.hasOwnProperty("open")) {
            var value = config.open;
            var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
            var index = mo.gameHelper.findValueForArray(rules.open, value);

            this.setCheckBoxSelect(Panel_fengding, index);
        }

        //比牌轮数
        var Panel_bipai = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_bipai");
        if (config.hasOwnProperty("bi")) {
            var value = config.bi;
            var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
            var index = mo.gameHelper.findValueForArray(rules.bi, value);
            this.setCheckBoxSelect(Panel_bipai, index);
        }

        //闷牌轮数
        var Panel_menpai = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_menpai");
        if (config.hasOwnProperty("men")) {
            var value = config.men;
            var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
            var index = mo.gameHelper.findValueForArray(rules.men, value);
            this.setCheckBoxSelect(Panel_menpai, index);
        }

        //豹子奖励
        var Panel_aaap = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_aaap");
        if (config.hasOwnProperty("aaap")) {
            var value = config.aaap;
            var rules = mo.gameRoomRuleHelper.getPszRuleStruct(this.mTableConfigPsz);
            var index = mo.gameHelper.findValueForArray(rules.aaap, value);
            this.setCheckBoxSelect(Panel_aaap, index);
        }

        //比牌规则
        var Panel_ssc = mo.seekWidgetByName(this.Panel_gamePsz, "Panel_ssc");
        if (config.hasOwnProperty("ssc")) {
            var value = config.ssc;
            var index = (value == 1 ? 0 : 1);
            this.setCheckBoxSelect(Panel_ssc, index);
        } else {
            this.setCheckBoxSelect(Panel_ssc, -1);
        }
    },

    updateConfigDzpk: function () {
        var config = this.mTableConfigDzpk;

        //大盲注
        var Panel_basepoint = mo.seekWidgetByName(this.Panel_gameDzpk, "Panel_basepoint");
        if (config.hasOwnProperty("basepoint")) {
            var value = config.basepoint;
            var index = -1;
            if (value == 2) {
                index = 0;
            } else if (value == 6) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_basepoint, index);
        }

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameDzpk, "Panel_jushu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var index = -1;
            if (value == 5) {
                index = 0;
            } else if (value == 10) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_jushu, index);
        }

        //闷
        var Panel_men = mo.seekWidgetByName(this.Panel_gameDzpk, "Panel_men");
        if (config.hasOwnProperty("men")) {
            var value = config.men;
            var index = (value == 1 ? 0 : 1);
            this.setCheckBoxSelect(Panel_men, index);
        }
    },

    updateConfigDtj: function () {
        var config = this.mTableConfigDtj;

        //锅的玩法
        if (config.hasOwnProperty("guo")) {
            var value = config.guo;

            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_guoKa").setVisible(value == 1);
            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_guoMax").setVisible(value == 1);
            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_paijiu").setVisible(value == 1);
            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_wanfa").setVisible(value == 0);
            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu").setVisible(value == 0);
            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jiabei").setVisible(value == 0);
            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_xuanfen").setVisible(value == 0);
            mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu_xiao").setVisible(value == 0);

            if (value == 0) {
                this.mTabButtonDtj[2].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_guopaijiu_n.png");

                var paijiu = config.paijiu;
                if (paijiu == 0) {
                    //大牌九
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu").setVisible(true);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu_xiao").setVisible(false);

                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_gz").setPositionY(-120);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_tjw").setPositionY(-120);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_wanfa").setPositionY(-180);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_xuanfen").setPositionY(-240);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jiabei").setPositionY(-300);

                    this.mTabButtonDtj[0].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_dapaijiu_s.png");
                    this.mTabButtonDtj[1].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_xiaopaijiu_n.png");
                } else {
                    //小牌九
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu").setVisible(false);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu_xiao").setVisible(true);

                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_gz").setPositionY(-120);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_tjw").setPositionY(-120);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_wanfa").setPositionY(-180);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_xuanfen").setPositionY(-240);
                    mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jiabei").setPositionY(-300);

                    this.mTabButtonDtj[0].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_dapaijiu_n.png");
                    this.mTabButtonDtj[1].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_xiaopaijiu_s.png");
                }

            } else {
                this.mTabButtonDtj[0].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_dapaijiu_n.png");
                this.mTabButtonDtj[1].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_xiaopaijiu_n.png");
                this.mTabButtonDtj[2].loadTextureNormal("res/ccs/hall_second/roomCreate/wanfa_guopaijiu_s.png");

                mo.seekWidgetByName(this.Panel_gameDtj, "Panel_gz").setPositionY(-240);
                mo.seekWidgetByName(this.Panel_gameDtj, "Panel_tjw").setPositionY(-240);
            }

        }


        var Panel_xuguo = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_xuguo");
        if (config.hasOwnProperty("xuguo")) {
            var value = config.xuguo;
            var index = (value == 1 ? 0 : 1);
            this.setCheckBoxSelect(Panel_xuguo, index);

            var Panel_guoKa = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_guoKa");
            var Text_text = mo.seekWidgetByName(Panel_guoKa, "Text_text");

            mo.gameHelper.setTextString(Text_text, " X" + (index == 1 ? "2" : "5"));
        }

        //锅的底分
        var Panel_guoMax = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_guoMax");
        if (config.hasOwnProperty("guomax")) {
            var value = config.guomax;
            var index = -1;
            if (value == 60) {
                index = 0;
            } else if (value == 80) {
                index = 1;
            } else if (value == 100) {
                index = 2;
            }
            this.setCheckBoxSelect(Panel_guoMax, index);
        }

        //大小牌九
        var Panel_paijiu = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_paijiu");
        if (config.hasOwnProperty("paijiu")) {
            var value = config.paijiu;
            var index = value;
            this.setCheckBoxSelect(Panel_paijiu, index);
        }

        //牌型选择
        var Panel_gz = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_gz");
        if (config.hasOwnProperty("ruleid")) {
            var value = config.ruleid;
            var index = ((value == 1 || value == 3) ? 0 : 1);
            this.setCheckBoxSelect(Panel_gz, index);
        }

        var Panel_tjw = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_tjw");
        if (config.hasOwnProperty("ruleid")) {
            var value = config.ruleid;
            var index = ((value == 1 || value == 4) ? 0 : 1);
            this.setCheckBoxSelect(Panel_tjw, index);
        }

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jushu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var index = -1;
            if (value == 12) {
                index = 0;
            } else if (value == 24) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_jushu, index);
        }

        //连庄
        var Panel_wanfa = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_wanfa");
        if (config.hasOwnProperty("hosttype")) {
            var value = config.hosttype;
            var index = value;
            this.setCheckBoxSelect(Panel_wanfa, index);
        }


        //加倍
        var Panel_jiabei = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_jiabei");
        if (config.hasOwnProperty("basepoint")) {
            var value = config.basepoint;
            var index = 0;
            if (value == 1) {
                index = 0;
            } else if (value == 2) {
                index = 1;
            } else if (value == 5) {
                index = 2;
            } else if (value == 8) {
                index = 3;
            } else if (value == 10) {
                index = 4;
            }
            this.setCheckBoxSelect(Panel_jiabei, index);
        }

        //选分
        var Panel_xuanfen = mo.seekWidgetByName(this.Panel_gameDtj, "Panel_xuanfen");
        if (config.hasOwnProperty("addratetime")) {
            var value = config.addratetime;
            var index = 0;
            if (value == 0) {
                index = 0;
                Panel_jiabei.setVisible(false);
            } else {
                index = 1;
                Panel_jiabei.setVisible(true);
            }

            if (Panel_xuanfen.isVisible() == false) {
                Panel_jiabei.setVisible(false);
            }

            this.setCheckBoxSelect(Panel_xuanfen, index);
        }
    },

    updateConfigPdk: function () {
        var config = this.mTableConfigPdk;

        //盘数
        var Panel_jushu = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_jushu");
        if (config.hasOwnProperty("maxpan")) {
            var value = config.maxpan;
            var index = -1;
            if (value == 2) {
                index = 0;
            } else if (value == 12) {
                index = 1;
            }
            this.setCheckBoxSelect(Panel_jushu, index);
        }

        //先出牌
        var Panel_hosttype = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_hosttype");
        if (config.hasOwnProperty("hosttype")) {
            var value = config.hosttype;
            var index = value;
            this.setCheckBoxSelect(Panel_hosttype, index);
        }

        //封顶
        var Panel_alltop = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_alltop");
        if (config.hasOwnProperty("alltop")) {
            var value = config.alltop;
            var index = value;
            this.setCheckBoxSelect(Panel_alltop, index);
        }

        //三带
        var Panel_ruleTriple = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_ruleTriple");
        if (config.hasOwnProperty("ruletriple")) {
            var value = config.ruletriple;
            var index = value;
            this.setCheckBoxSelect(Panel_ruleTriple, index);
        }

        //飞机
        var Panel_ruleAirplane = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_ruleAirplane");
        if (config.hasOwnProperty("ruleairplane")) {
            var value = config.ruleairplane;
            var index = value;
            this.setCheckBoxSelect(Panel_ruleAirplane, index);
        }

        //四带
        var Panel_ruleFour = mo.seekWidgetByName(this.Panel_gamePdk, "Panel_ruleFour");
        if (config.hasOwnProperty("rulefour")) {
            var value = config.rulefour;
            if (value == 0){
                index = 0;
            }else{
                index = -1;
            }
            this.setCheckBoxSelect(Panel_ruleFour, index);
        }
    },

    setCheckBoxSelect: function (node, index) {
        for (var i = 0; i < 5; i++) {
            var item = mo.seekWidgetByName(node, "Panel_item" + i);
            var isCheck = (i === index);
            if (item) {
                var checkBox = mo.seekWidgetByName(item, "CheckBox");
                checkBox.setSelected(isCheck);

                var Text_text = mo.seekWidgetByName(item, "Text_text");
                // Text_text.setTextColor(isCheck ? cc.color(208, 36, 28) : cc.color(65, 118, 156));
                Text_text.setTextColor(cc.color(255, 255, 255));
                if (mo.gameHelper.projectCode == 2) {
                    Text_text.setColor(isCheck ? cc.color(242, 76, 2) : cc.color(146, 107, 56));
                } else {
                    Text_text.setColor(isCheck ? cc.color(90, 46, 11) : cc.color(90, 46, 11));
                }
            }
        }
    }
});